package com.datang.litejvm.clz;

/**
 * @author: 顶风少年
 * @Description: 方法访问标志
 * @date: 11:32 2022/6/12
 **/
public class MethodAccessFlag {
    private int flagValue;

    public MethodAccessFlag(int value) {
        this.flagValue = value;
    }

    public int getFlagValue() {
        return flagValue;
    }

    public void setFlagValue(int flag) {
        this.flagValue = flag;
    }

    public boolean isPublic() {
        return (this.flagValue & 0x0001) != 0;
    }

    public boolean isPrivate() {
        return (this.flagValue & 0x0002) != 0;
    }

    public boolean isProtected() {
        return (this.flagValue & 0x0004) != 0;
    }

    public boolean isStatic() {
        return (this.flagValue & 0x0008) != 0;
    }

    public boolean isFinal() {
        return (this.flagValue & 0x0010) != 0;
    }

    public boolean isSynchronized() {
        return (this.flagValue & 0x0020) != 0;
    }

    public boolean isBridge() {
        return (this.flagValue & 0x0040) != 0;
    }

    public boolean isVarargs() {
        return (this.flagValue & 0x0080) != 0;
    }

    public boolean isNative() {
        return (this.flagValue & 0x0100) != 0;
    }

    public boolean isAbstract() {
        return (this.flagValue & 0x0400) != 0;
    }

    public boolean isStrictfp() {
        return (this.flagValue & 0x0800) != 0;
    }

    public boolean isSynthetic() {
        return (this.flagValue & 0x1000) != 0;
    }
}
